#! /usr/bin/python3
# author ckm
import threading
import time


def sing():
    for i in range(3):
        print('正在唱歌--- %d' % i)
        time.sleep(1)



def dance():
    for i in range(3):
        print('正在跳舞--- %d' % i)
        time.sleep(1)


if __name__ == '__main__':
    print('---开始----')
    t1 = threading.Thread(target=sing)
    t2 = threading.Thread(target=dance)

    t1.start()
    t2.start()

    while True:
        length = (len(threading.enumerate()))
        print('当前线程的数量为%d' % length)
        if length <= 1:
            break
        time.sleep(0.5)
    print('---结束----')

